#!/bin/bash

whoami
ip a
PKG_NAME='tvucc-device.jar'
echo "stop the program and remove the package" 
ssh root@10.12.22.23 "
       cd /home/program/commandcenterplus 
       bash tvucc-device-deploy.sh  &&
       exit "
echo "transfer package to server start"
pwd
scp target/${PKG_NAME} root@10.12.22.23:/home/program/commandcenterplus
echo "transfer package to 22.23 server end"

##complete on node, then sleep 60s, deploy another one.
sleep 60

ssh root@10.12.22.22 "
       cd /home/program/commandcenterplus/tvucc-device
       bash tvucc-device-deploy.sh  &&
       exit "
echo "transfer package to server start"
pwd
scp target/${PKG_NAME} root@10.12.22.22:/home/program/commandcenterplus/tvucc-device
echo "transfer package to 22.22 server end"

